package com.magiccompass.alipay.barcode.entity;

import java.sql.Timestamp;
import java.util.Calendar;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "TD_MERCHANT_QRCODE")
@DynamicUpdate(value= true)
public class MerchantQRCode {
	@Id
	@Column(name = "ID")
	@GeneratedValue
	private Integer id;
	
	@ManyToOne(cascade=CascadeType.REFRESH)
	@JoinColumn(name="merchant_id", nullable=false)
	private MerchantInfo merchant;
	
	@Column(name = "qrcode", nullable=false, length=512)
	private String qrCode;
	
	@Column(name = "qrcode_img_url", nullable=false, length=1000)
	private String qrcodeImgUrl;
    
	@Column(name = "create_by", nullable=false)
	private Integer createBy;
	
	@Column(name = "create_time", nullable=false)
	private Timestamp createTime = new Timestamp(Calendar.getInstance().getTimeInMillis());

	@Column(name = "del_flag")
	private String delFlag = "F";
	
	public Integer getCreateBy() {
		return createBy;
	}
	public void setCreateBy(Integer createBy) {
		this.createBy = createBy;
	}
	public Timestamp getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}
	public String getDelFlag() {
		return delFlag;
	}
	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
	public MerchantInfo getMerchant() {
		return merchant;
	}
	public void setMerchant(MerchantInfo merchant) {
		this.merchant = merchant;
	}
	public String getQrCode() {
		return qrCode;
	}
	public void setQrCode(String qrCode) {
		this.qrCode = qrCode;
	}
	public String getQrcodeImgUrl() {
		return qrcodeImgUrl;
	}
	public void setQrcodeImgUrl(String qrcodeImgUrl) {
		this.qrcodeImgUrl = qrcodeImgUrl;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
}